package com.situ.service.impl;


import com.situ.bean.Category;
import com.situ.dao.CartMapper;
import com.situ.dao.CategoryDao;
import com.situ.service.ICategoryService;
import com.situ.util.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;
@Service
public class CategoryService implements ICategoryService {
    @Autowired
    CategoryDao categoryDao;

    @Override
    public int addCategory(Category category) {
        return categoryDao.addCategory(category);
    }

    @Override
    public int deleteCategory(int id) {
        return categoryDao.deleteCategory(id);
    }

    @Override
    public int editCategory(Category category) {
        return categoryDao.editCategory(category);
    }

    @Override
    public Category getCategoryByID(int id) {
        return categoryDao.getCategoryByID(id);
    }

//    @Override
//    public List<Category> getAllCategories(Page page, String text) {
//        return categoryDao.getAllCategories(page, text);
//    }

    @Override
    public List<Category> getChildrenCategories(int id) {
        return categoryDao.getChildrenCategories(id);
    }





}































